package com.gxa.controller;

import com.gxa.service.AccountService;
import com.gxa.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
public class AccountController {
  
  @Autowired
  private AccountService accountService;

  @RequestMapping("/account/decrease")
  public Result decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money) {
    this.accountService.decrease(userId, money);
    return new Result().ok();
  }
}